﻿Imports lbGlobalcom

Public Class cApp
    Public Shared Sub RefrescaCadConn(ByVal User As String, ByVal Pass As String)
        Dim CadConn As System.Text.StringBuilder = New System.Text.StringBuilder(My.Settings.ConnInicial)
        CadConn.Replace("DATA SOURCE=1", "DATA SOURCE=" + My.Settings.ServerBD + ":" + My.Settings.Puerto)
        CadConn.Replace("PASSWORD=1", "PASSWORD=" + Pass)
        CadConn.Replace("USER ID=1", "USER ID=" + User)
        My.Settings("ConnectionString") = CadConn.ToString
        lbGlobalcom.cGeneral.InsertaCadConn(CadConn.ToString)
    End Sub

End Class

Public Class cEjecutarMenu
    Const EnsabladoPPal As String = "GlobalcomApp"
    Private Sub AbreForma(ByVal Ensablado As String, ByVal FPPal As Form)
        Try
            Dim Tipo As Type = System.Type.GetType(Ensablado)
            Dim Formulario As Form = Activator.CreateInstance(Tipo)
            Formulario.TopLevel = False
            Formulario.FormBorderStyle = FormBorderStyle.None
            Formulario.Dock = DockStyle.Fill
            'FPPal.Controls("Panel2").Controls.Add(Formulario)
            Formulario.Show()
        Catch ex As Exception
            Throw ex
        End Try
    End Sub
    Public Sub New(ByVal IdObjec As Integer, ByVal FormaPPal As Form)
        Try
            Dim MiMnObj As ObjetosMN = New ObjetosMN(IdObjec)
            If MiMnObj.TipoObjeto = 1 Then
                AbreForma(EnsabladoPPal & "." & MiMnObj.NombreObjeto, FormaPPal)
            End If
        Catch ex As Exception
            Throw ex
        End Try
    End Sub
End Class